#update setting of every co ltd.
import getpath
import config_json
import os
import json
import logging
def upOne(fen):#upgrade setting.json file
    file_name = os.path.join(getpath.getpath(),"setting",fen,"setting.json")
    f=open(file_name, encoding="utf-8")
    old_setting = json.load(f)
    f.close()
    for one in config_json.setting.keys():
        try:
            config_json.setting[one]=old_setting[one]
        except KeyError:
            print(one)
            pass
    new_value=json.dumps(config_json.setting)
    logging.info("output")        
    set_file=open(file_name, 'w',encoding="utf-8")
    set_file.write(new_value)
    set_file.close()
config_json.read_setting()
for one in config_json.setting.keys():
    print(one)
upOne("bj")
upOne("qd")

